<?php
$areas=$community[0];
$years=date("Y");
$months=date("Y-m");
$days=date("Y年m月d日");
$thisDay=date("Y-m-d");

$code=input("code");
if(!empty($code))
{
    $com=db("community")->where(array("code"=>$code))->find();
    if($com!=false && $com!=null)
    {
        $areas=$com;
    }
}
$date=input("date");
if(!empty($date))
{
    $years=date("Y",strtotime($date));
    $months=date("Y-m",strtotime($date));
    $days=date("Y年m月d日",strtotime($date));
    $thisDay=date("Y-m-d",strtotime($date));
}

$whereyears=array(strtotime($years."-1-1 00:00:00"),strtotime($years."-1-1 00:00:00" ." +1 year"));
$wheremonths=array(strtotime($months."-1 00:00:00"),strtotime($months."-1 00:00:00" ." +1 month"));


function getsum($table,$where,$sum)
{
    return db($table)->where($where)->sum($sum);
}
?>
<div class="panel panel-default panel-intro">
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">

            <div class="commonsearch-table">
                <form method="get" class="form-horizontal form-commonsearch nice-validator n-default" role="form" action="" novalidate="novalidate">
                    <fieldset>
                        <div class="row">
                            <div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-3">
                                <label for="code" class="control-label col-xs-4">园区</label>
                                <div class="col-xs-12 col-sm-8">
                                    <select id="code" class="form-control" name="code">
                                        {foreach name="community" item="vo"}
                                        <option value="{$vo.code}" <?php echo($areas["code"]==$vo["code"]?"selected":""); ?>>{$vo.name}</option>
                                        {/foreach}
                                    </select>
                                </div>
                            </div>
                            <div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-4">
                                <label class="control-label col-xs-4">日期</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" name="date" value='<?php echo(date("Y-m-d",strtotime($thisDay))); ?>' />
                                </div>
                            </div>
                            <div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-3">
                                <div class="col-sm-8 col-xs-offset-4">
                                    <button type="button" class="btn btn-primary" id="common_search">查询</button>
                                    <button type="reset" class="btn btn-default">重置</button>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                </form>
            </div>
            
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div style="text-align:center;">
                    <h2>{$areas.name}收支情况表</h2>
                    <h4>所属日期：{$days}</h4>
                    </div>
                    <table class="table table-striped table-bordered table-hover" width="100%">
                        <colgroup>
                            <col width="45" style="width:45px"/>
                            <col width="217" style="width:218px"/>
                            <col width="132" style="width:132px" span="2"/>
                            <col width="200" style="width:200px"/>
                        </colgroup>
                        <tbody>
                            <tr><th>序号</th><th>项目</th><th>本月数</th><th>本年累计数</th><th>备注</th></tr>
                            <tr style="height:33px" class="firstRow">
                                <td width="45" style="">
                                    一
                                </td>
                                <td width="218" style="">
                                    收入
                                </td>
                                <?php 
                                $expensesyears=0;
                                $expensesmonths=0;
                                $code=db("expenses_project")->where(array("paymentid"=>array("in",array(7,10,11,12,13,14,15,16,17,18))))->column("code");
                                if($code!=false && $code!=null && is_array($code))
                                {
                                    $expensesyears=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$whereyears)),"amount_paid");
                                    $expensesmonths=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$wheremonths)),"amount_paid");
                                }
                                ?>
                                <td><?php echo(number_format($expensesmonths,2)); ?></td>
                                <td><?php echo(number_format($expensesyears,2)); ?></td>
                                <td width="200" style=""></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    1
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 租金收入
                                </td>
                                <?php
                                $expensesyears=0;
                                $expensesmonths=0;
                                $code=db("expenses_project")->where(array("paymentid"=>7))->column("code");
                                if($code!=false && $code!=null && is_array($code))
                                {
                                    $expensesyears=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$whereyears)),"amount_paid");
                                    $expensesmonths=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$wheremonths)),"amount_paid");
                                }
                                ?>
                                <td><?php echo(number_format($expensesmonths,2)); ?></td>
                                <td><?php echo(number_format($expensesyears,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    2
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 物业费收入
                                </td>
                                <?php
                                $expensesyears=0;
                                $expensesmonths=0;
                                $code=db("expenses_project")->where(array("paymentid"=>10))->column("code");
                                if($code!=false && $code!=null && is_array($code))
                                {
                                    $expensesyears=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$whereyears)),"amount_paid");
                                    $expensesmonths=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$wheremonths)),"amount_paid");
                                }
                                ?>
                                <td><?php echo(number_format($expensesmonths,2)); ?></td>
                                <td><?php echo(number_format($expensesyears,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    3
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 税费收入
                                </td>
                                <?php
                                $expensesyears=0;
                                $expensesmonths=0;
                                $code=db("expenses_project")->where(array("paymentid"=>11))->column("code");
                                if($code!=false && $code!=null && is_array($code))
                                {
                                    $expensesyears=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$whereyears)),"amount_paid");
                                    $expensesmonths=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$wheremonths)),"amount_paid");
                                }
                                ?>
                                <td><?php echo(number_format($expensesmonths,2)); ?></td>
                                <td><?php echo(number_format($expensesyears,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    4
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 保证金收入
                                </td>
                                <?php
                                $expensesyears=0;
                                $expensesmonths=0;
                                $code=db("expenses_project")->where(array("paymentid"=>12))->column("code");
                                if($code!=false && $code!=null && is_array($code))
                                {
                                    $expensesyears=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$whereyears)),"amount_paid");
                                    $expensesmonths=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$wheremonths)),"amount_paid");
                                }
                                ?>
                                <td><?php echo(number_format($expensesmonths,2)); ?></td>
                                <td><?php echo(number_format($expensesyears,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    5
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 广告费收入
                                </td>
                                <?php
                                $expensesyears=0;
                                $expensesmonths=0;
                                $code=db("expenses_project")->where(array("paymentid"=>13))->column("code");
                                if($code!=false && $code!=null && is_array($code))
                                {
                                    $expensesyears=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$whereyears)),"amount_paid");
                                    $expensesmonths=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$wheremonths)),"amount_paid");
                                }
                                ?>
                                <td><?php echo(number_format($expensesmonths,2)); ?></td>
                                <td><?php echo(number_format($expensesyears,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    6
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 停车收入
                                </td>
                                <?php
                                $expensesyears=0;
                                $expensesmonths=0;
                                $code=db("expenses_project")->where(array("paymentid"=>14))->column("code");
                                if($code!=false && $code!=null && is_array($code))
                                {
                                    $expensesyears=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$whereyears)),"amount_paid");
                                    $expensesmonths=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$wheremonths)),"amount_paid");
                                }
                                ?>
                                <td><?php echo(number_format($expensesmonths,2)); ?></td>
                                <td><?php echo(number_format($expensesyears,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    7
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 电费收入
                                </td>
                                <?php
                                $expensesyears=0;
                                $expensesmonths=0;
                                $code=db("expenses_project")->where(array("paymentid"=>15))->column("code");
                                if($code!=false && $code!=null && is_array($code))
                                {
                                    $expensesyears=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$whereyears)),"amount_paid");
                                    $expensesmonths=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$wheremonths)),"amount_paid");
                                }
                                ?>
                                <td><?php echo(number_format($expensesmonths,2)); ?></td>
                                <td><?php echo(number_format($expensesyears,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    8
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 水费收入
                                </td>
                                <?php
                                $expensesyears=0;
                                $expensesmonths=0;
                                $code=db("expenses_project")->where(array("paymentid"=>16))->column("code");
                                if($code!=false && $code!=null && is_array($code))
                                {
                                    $expensesyears=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$whereyears)),"amount_paid");
                                    $expensesmonths=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$wheremonths)),"amount_paid");
                                }
                                ?>
                                <td><?php echo(number_format($expensesmonths,2)); ?></td>
                                <td><?php echo(number_format($expensesyears,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    9
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 其他收入
                                </td>
                                <?php
                                $expensesyears=0;
                                $expensesmonths=0;
                                $code=db("expenses_project")->where(array("paymentid"=>17))->column("code");
                                if($code!=false && $code!=null && is_array($code))
                                {
                                    $expensesyears=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$whereyears)),"amount_paid");
                                    $expensesmonths=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$wheremonths)),"amount_paid");
                                }
                                ?>
                                <td><?php echo(number_format($expensesmonths,2)); ?></td>
                                <td><?php echo(number_format($expensesyears,2)); ?></td>
                                <td>
                                    含废品收入等
                                </td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    10
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 借款收入
                                </td>
                                <?php
                                $expensesyears=0;
                                $expensesmonths=0;
                                $code=db("expenses_project")->where(array("paymentid"=>18))->column("code");
                                if($code!=false && $code!=null && is_array($code))
                                {
                                    $expensesyears=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$whereyears)),"amount_paid");
                                    $expensesmonths=getsum("expenses",array("community_code"=>$areas["code"],"project_code"=>array("in",$code),"create_time"=>array("between",$wheremonths)),"amount_paid");
                                }
                                ?>
                                <td><?php echo(number_format($expensesmonths,2)); ?></td>
                                <td><?php echo(number_format($expensesyears,2)); ?></td>
                                <td>
                                    含预收等，详见附件
                                </td>
                            </tr>
                            <tr style="height:33px">
                                <td style=""></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    二
                                </td>
                                <td>
                                    支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>array("in",array(8,9,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42)),"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>array("in",array(8,9,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42)),"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    1
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 职工薪酬支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>array("in",array(9,19,20)),"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>array("in",array(9,19,20)),"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    a
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 管理人员薪酬支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>9,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>9,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2));?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    b
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 保洁人员薪酬支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>19,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>19,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    c
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 安保人员薪酬支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>20,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>20,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    2
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 福利支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>21,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>21,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    3
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 办公费支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>22,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>22,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    4
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 业务招待支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>23,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>23,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    5
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 差旅费支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>24,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>24,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    6
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 绿化维护费
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>25,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>25,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    7
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 工程维修保养支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>array("in",array(26,27,28)),"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>array("in",array(26,27,28)),"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    a
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 维修支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>27,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>27,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    b
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 设备保养支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>28,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>28,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    8
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 环卫垃圾清运费
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>29,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>29,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    9
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 咨询服务费支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>30,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>30,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    10
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 电费支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>31,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>31,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    11
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 水费支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>32,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>32,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    12
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 财务费用
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>array("in",array(33,34,35)),"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>array("in",array(33,34,35)),"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    a
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 利息支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>34,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>34,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    b
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 手续费支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>35,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>35,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    13
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 税费支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>array("in",array(36,37,38,39,40)),"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>array("in",array(36,37,38,39,40)),"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    a
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 增值税支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>37,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>37,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    b
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 附加支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>38,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>38,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    c
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 印花税支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>39,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>39,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    d
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 所得税支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>40,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>40,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    14
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 其他支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>41,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2));?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>41,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    15
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 借款支出
                                </td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>42,"create_time"=>array("between",$wheremonths)),"amount");echo(number_format($pay,2)); ?></td>
                                <td><?php $pay=getsum("pay",array("community_code"=>$areas["code"],"paymentid"=>42,"create_time"=>array("between",$whereyears)),"amount");echo(number_format($pay,2)); ?></td>
                                <td>
                                    含预付等，详见附件
                                </td>
                            </tr>
                            <tr style="height:33px">
                                <td style=""></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    三
                                </td>
                                <td>
                                    固定资产
                                </td>
                                <td> </td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    1
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 固定资产购入
                                </td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    2
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 大修支出
                                </td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style=""></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    四
                                </td>
                                <td>
                                    结余
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    1
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 现金
                                </td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    2
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 高显光个人卡
                                </td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    3
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 房产信息对公账户
                                </td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    4
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 物业公司对公账户
                                </td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr style="height:33px">
                                <td style="">
                                    5
                                </td>
                                <td>
                                    &nbsp;&nbsp;&nbsp; 数控公司对公账户
                                </td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                        </tbody>
                    </table>

                </div>
            </div>

        </div>
    </div>
</div>